/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.asseco.mio;

import com.asseco.mio.codex.MeasuresTaken;
import com.asseco.mio.codex.ResponsibilityReason;
import com.asseco.mio.codex.ResponsibilityType;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import org.appfuse.model.BaseObject;
import org.hibernate.annotations.GenericGenerator;
/**
 *
 * @author gjoko.mitrovski
 */
@Entity
@Table(name = "DISCIPLINE_PROC")
public class DisciplineProcedure extends BaseObject {

    private String id;
    private BasicInfo employment;
    private WorkPosition workPosition;
    private ResponsibilityType respType;
    private ResponsibilityReason respReason;
    private MeasuresTaken measures;
    private Date procDate;
    private Boolean status;
    private Date activeDate;
    private Date passiveDate;

        @Column(name = "ACTIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getActiveDate() {
        return activeDate;
    }

    public void setActiveDate(Date activeDate) {
        this.activeDate = activeDate;
    }
    @ManyToOne
   @JoinColumn(name = "EMP_ID")
    public BasicInfo getEmployment() {
        return employment;
    }

    public void setEmployment(BasicInfo employment) {
        this.employment = employment;
    }
 @Id
    @GeneratedValue(generator = "system-uuid")
    @Column(length = 40)
@GenericGenerator(name = "system-uuid", strategy = "uuid")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    @ManyToOne
   @JoinColumn(name = "MEASURE_ID")
    public MeasuresTaken getMeasures() {
        return measures;
    }

    public void setMeasures(MeasuresTaken measures) {
        this.measures = measures;
    }
    @Column(name = "PASSIVE_DATE")
    @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
    public Date getPassiveDate() {
        return passiveDate;
    }

    public void setPassiveDate(Date passiveDate) {
        this.passiveDate = passiveDate;
    }
    @Column(name = "PROC_DATE")
    @Temporal(value = javax.persistence.TemporalType.DATE)
    public Date getProcDate() {
        return procDate;
    }

    public void setProcDate(Date procDate) {
        this.procDate = procDate;
    }
    @ManyToOne
   @JoinColumn(name = "RESP_REASON_ID")
    public ResponsibilityReason getRespReason() {
        return respReason;
    }

    public void setRespReason(ResponsibilityReason respReason) {
        this.respReason = respReason;
    }
    @ManyToOne
   @JoinColumn(name = "RESP_TYPE_ID")
    public ResponsibilityType getRespType() {
        return respType;
    }

    public void setRespType(ResponsibilityType respType) {
        this.respType = respType;
    }
   @Column(name = "STATUS", length = 200)
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }
    @ManyToOne
   @JoinColumn(name = "POS_ID")
    public WorkPosition getWorkPosition() {
        return workPosition;
    }

    public void setWorkPosition(WorkPosition workPosition) {
        this.workPosition = workPosition;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final DisciplineProcedure other = (DisciplineProcedure) obj;
        if ((this.id == null) ? (other.id != null) : !this.id.equals(other.id)) {
            return false;
        }
        if (this.employment != other.employment && (this.employment == null || !this.employment.equals(other.employment))) {
            return false;
        }
        if (this.workPosition != other.workPosition && (this.workPosition == null || !this.workPosition.equals(other.workPosition))) {
            return false;
        }
        if (this.respType != other.respType && (this.respType == null || !this.respType.equals(other.respType))) {
            return false;
        }
        if (this.respReason != other.respReason && (this.respReason == null || !this.respReason.equals(other.respReason))) {
            return false;
        }
        if (this.measures != other.measures && (this.measures == null || !this.measures.equals(other.measures))) {
            return false;
        }
        if (this.procDate != other.procDate && (this.procDate == null || !this.procDate.equals(other.procDate))) {
            return false;
        }
        if (this.status != other.status && (this.status == null || !this.status.equals(other.status))) {
            return false;
        }
        if (this.activeDate != other.activeDate && (this.activeDate == null || !this.activeDate.equals(other.activeDate))) {
            return false;
        }
        if (this.passiveDate != other.passiveDate && (this.passiveDate == null || !this.passiveDate.equals(other.passiveDate))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DisciplineProcedure{" + "id=" + id + "employment=" + workPosition.getEmployment().getId() + "workPosition=" + workPosition.getId() + "respType=" + respType + "respReason=" + respReason + "measures=" + measures + "procDate=" + procDate + "status=" + status + "activeDate=" + activeDate + "passiveDate=" + passiveDate + '}';
    }

    

    @Override
    public int hashCode() {
        throw new UnsupportedOperationException("Not supported yet.");
    }


}
